package com.yxhl.zoume.di.module;

import com.yxhl.zoume.ZouMeApplication;
import com.yxhl.zoume.data.http.repository.appraisal.AppraisalRepository;
import com.yxhl.zoume.data.http.repository.busticket.BusTicketRepository;
import com.yxhl.zoume.data.http.repository.car.ExpressCarRepository;
import com.yxhl.zoume.data.http.repository.car.OfficialCarRepository;
import com.yxhl.zoume.data.http.repository.car.SpecialCarRepository;
import com.yxhl.zoume.data.http.repository.coupon.CouponRepository;
import com.yxhl.zoume.data.http.repository.identification.IdentificationRepository;
import com.yxhl.zoume.data.http.repository.mywallet.MyWalletRepository;
import com.yxhl.zoume.data.http.repository.passenger.PassengerRepository;
import com.yxhl.zoume.data.http.repository.pay.PaymentRepository;
import com.yxhl.zoume.data.http.repository.splash.SplashBannerRepository;
import com.yxhl.zoume.data.http.repository.tripsmgnt.TripsRepository;
import com.yxhl.zoume.data.http.repository.updateapp.UpdateAppRepository;
import com.yxhl.zoume.data.http.repository.user.AccountRepository;
import com.yxhl.zoume.data.http.repository.usercenter.UserCenterRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.AccountDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.AppraisalDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.BusTicketDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.CouponDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.ExpressCarDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.IdentificationDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.MyWalletDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.OfficialCarDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.PassengerDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.PaymentDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.SpecialCarDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.SplashDataBannerRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.TripsDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.UpdateAppDataRepository;
import com.yxhl.zoume.data.http.rest.repositoryimpl.UserCenterDataRepository;
import com.yxhl.zoume.domain.DomainConstants;

import javax.inject.Named;
import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import rx.Scheduler;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Xboy on 16/3/2.
 */
@Module
public class AppModule {
    private final ZouMeApplication application;

    public AppModule(ZouMeApplication application) {
        this.application = application;
    }

    @Provides
    @Singleton
    ZouMeApplication provideAppContext() {
        return application;
    }

    @Provides
    @Singleton
    @Named(DomainConstants.UI_THREAD)
    Scheduler provideUiThread() {
        return AndroidSchedulers.mainThread();
    }

    @Provides
    @Singleton
    @Named(DomainConstants.EXECUTOR_THREAD)
    Scheduler provideExecutorThread() {
        return Schedulers.io();
    }

    @Provides
    @Singleton
    AccountRepository provideUserRepository(AccountDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    TripsRepository provideTripsRepository(TripsDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    PassengerRepository providePassengerRepository(PassengerDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    BusTicketRepository provideBusTicketRepository(BusTicketDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    PaymentRepository providesOrderRepository(PaymentDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    SpecialCarRepository provideSpecialCarRepository(SpecialCarDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    OfficialCarRepository provideOfficialCarRepository(OfficialCarDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    UserCenterRepository provideUserCenterRepository(UserCenterDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    UpdateAppRepository provideUpdateAppRepository(UpdateAppDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    AppraisalRepository provideAppraisalRepository(AppraisalDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    IdentificationRepository provideIdentificationRepository(IdentificationDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    SplashBannerRepository provideSplashRepository(SplashDataBannerRepository repository) {
        return repository;
    }


    @Provides
    @Singleton
    CouponRepository provideCouponRepository(CouponDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    MyWalletRepository provideMyWalletRepository(MyWalletDataRepository repository) {
        return repository;
    }

    @Provides
    @Singleton
    ExpressCarRepository provideExpressCarRepository(ExpressCarDataRepository repository) {
        return repository;
    }
}
